SerialPrint II is an adaptable DA that prints textual information (no graphics) on printers with builtin fonts connected to one of the two serial ports. Because the printer's builtin fonts are used, printing is much faster than if a standard printer driver were used. SerialPrint II is useful in cases where fancy formatting is less important than fast printing, e.g. draft program listings and text from BBS sessions. Files to be printed by SerialPrint II must have type TEXT and contain a carriage return at the end of each line; the text portion of the Clipboard can also be printed.
Some examples of printers that can be used with SerialPrint II include the Apple ImageWriter (both I and II), Epson FX or compatible printers with a serial interface or an outboard serial to parallel converter, and the Hewlett Packard DeskJet (or Plus or 500). An example of a printer that cannot be used with SerialPrint II is the Hewlett Packard DeskWriter, which does not support builtin fonts; the new Apple StyleWriter may also fall in this category. SerialPrint II does not support AppleTalk or PostScript printers.
Apple's policy seems to be that printers should be driven through high level drivers; if you want the full range of imaging options (multiple fonts, font scaling, and graphics) that's your only option. SerialPrint II uses only interfaces documented in “Inside Macintosh”; unless Apple retires the ROM routines for driving serial ports (not very likely), there should be no problems using SerialPrint II with either System 6 or 7.
Supported Printers
This version of SerialPrint II supports the Apple ImageWriter I and II and compatible printers; Epson FX and compatible printers; and the Hewlett Packard DeskJet, DeskJet Plus, and DeskJet 500. You'll probably need to use CTS flow control with the ImageWriter I; the other supported printers should work with Xon/Xoff flow control.
Configuring SerialPrint II
SerialPrint II comes figured with control sequences for the Apple ImageWriter, the Epson FX, and the Hewlett Packard DeskJet. There is a dialog box that lets the user change any of the parameters associated with a printer, either permanently or just for the current use. Definitions for new printer types can be added by judicious use of ResEdit. A future version of SerialPrint II will enable the user to add printer definitions directly from SerialPrint II.
Each of these definitions has multiple setups associated with it, e.g. for Elite, Pica, or Compressed type. There is a dialog box that lets the user change any of the parameters associated with a setup, either permanently or just for the current use. Definitions for new setups can be added by judicious use of ResEdit. The next version of SerialPrint II will enable the user to add setup definitions directly from SerialPrint II.
Changes to Definitions
SerialPrint II allows both temporary and permanent changes; a temporary change applies only to the current session, while a permanent change causes modification of the resource containing the definition and applies to the current and future sessions. SerialPrint II dialog boxes normally contain Use, Save, and Revert buttons.
• Use causes SerialPrint II to use the new values temporarily; the values stored in the associated resource are not modified. If you switch to another printer (setup) and then switch back to the current printer (setup), the values stored in the resource will be reloaded.
• Save causes SerialPrint II to update the associated resource, thereby making the changes permanent.
• Revert causes SerialPrint II to reload the values from the associated resource, thereby undoing the changes made since the last use of Save.
SerialPrint II Menu
The SerialPrint II menu contains the following items: About SerialPrint II…, Printers, Setups, Print…, Print Clipboard, Options…, and Quit.
About SerialPrint II
The About SerialPrint II… menu item causes display of the the startup dialog box, which contains a button that can be used access online help. The startup dialog box contains a Print… button that can be used to immediately start printing a file.
Printers
The Printers menu item has a hierarchical menu that lists the supported printers and the item Modify Printers…. The default printer selection is indicated by a check mark. The Modify Printers… item leads to a dialog box that lets the user set the port, baud rate, and flow control to be used with the printer. A popup menu in this dialog box lets the user pick one of the supported printers. A Control Strings… button leads to a sub-dialog box that lets the user change the strings sent to the printer at the end of each line, at the top & bottom of each page, and at the end of file. If you experience overruns and misprinting using the default Xon/Xoff flow control, try using CTS. The flow control radio button won’t be visible on Macs with ROM IDs less than 117, in which case only CTS is available.
Setups
The Setups menu item has a hierarchical menu that lists the setups defined for the current printer and the item Modify Setups…. The default setup is indicated by a check mark. The Modify Setups… item leads to a dialog box that lets the user set the parameters associated with the setup. A popup menu in this dialog box lets the user pick one of the supported setups.
The following setup values are defined:
• Init String: The character string to be sent to the printer to reset any pre-existing modes and establish the mode defined by the setup, e.g. Pica. A control character, e.g. CTRL-A, is represented by ^ followed by the character, e.g. ^A. The ESC character is represented by ^[.
• Page parameters: lines per page, characters per line, spaces per tab, and left margin.
• Sheet feed or continuous paper. These radio buttons appear only if the “sheet feeder available” box was checked in the Printer definition.
There is a user definable header associated with each setup. If enabled, the header is printed at the top of each page. The following sequences have special meaning within the header string:
&n : insert name of file being printed
&m : insert modification date/time of file being printed
&c : insert creation date/time of file being printed
: insert current page number
The default heading string is “&n &m - Page ”
Print… and Print Clipboard
The Print… menu item leads to a standard file dialog box that shows only TEXT files; the selected file is printed using the current setup on the current printer. The Print Clipboard menu item causes the text portion of the contents of the Clipboard to be printed. Enter the sequence command-period to terminate printing. SerialPrint II checks for the terminate sequence after each line in the file being printed. Depending on the size of the buffer in the printer, the printer may not stop until additional lines are printed. If it is important that the printer stop immediately, turn off the printer.
Options
The Options… menu item leads to a dialog box that lets the user determine whether or not a dialog box is displayed when SerialPrint II starts, whether the serial driver should be closed when the user quits SerialPrint II (if ROM id >= 118), whether long lines should be truncated or wrapped, and whether 8-bit characters not part of the 7-bit ASCII set should be passed through unchanged, converted to ‘?’, or translated to another characters. If you plan to use SerialPrint II while a communications program is active, you should not use the close driver on quit option. If truncation is requested, long lines are printed with ‘\’ in the rightmost print position and excess characters are ignored. If wrapping is selected, long lines are printed with ‘\’ in the rightmost print position and remaining characters are printed on as many additional lines as are required. If translation is selected, the user can specify “from” and “to” strings. During printing, each 8-bit character is looked up in the “from” string. If found, it is replaced by the corresponding character in the “to” string; otherwise, it is replaced by ‘?’. All changes made in the Options dialog box are permanent.
Adding a New Printer Type
Currently, a new printer type can only be added by using ResEdit or some other resource editor. Make all changes to a copy of SerialPrint II.
1. Add the name of the new printer to the Printers menu (ID 15998).
2. Create a new MENU resource whose resource name and menu name are the same as the name added to the Printers menu; use the next available MENU resource ID.
3. Populate the new MENU with the names of the setups to be associated with the new printer type.
4. Create a new SPpr resource whose resource name is the same as the name of the printer; use the next available SPpr resource ID. A SPpr TMPL resource is provided so you can fill in the fields. New values for any of these fields can be set when SerialPrint II is executing.
5. Create a new SPsu resource for each setup specified in step 3; set the resource name to the name of the setup. A SPsu TMPL is provided so you can fill in the fields in these resources. New values for any of these fields can be set when SerialPrint II is executing.
When you next activate SerialPrint II, your new printer and associated setups should appear. If you have problems, double check the resource naming and numbering conventions described above.
Installing SerialPrint II
This version of SerialPrint II can be used with or without a suitcase utility such as Suitcase II, MasterJuggler, or Font/DA Juggler Plus. The resource numbering problem in the 1.0 and 1.0.1 releases has been corrected. Those of you running pre-System 7 software can now use Font/DA Mover to install SerialPrint II in your System file or can open it with a suitcase utility. Don't be alarmed if you get an alert from your virus detection software the first time you run SerialPrint II after installing it with Font/DA Mover; this is normal, allow the flagged operation to proceed.
CDEF Resources
You can skip this section, which explains how SerialPrint II uses CDEF resources, if you're not technically oriented.
SerialPrint II contains a real CDEF that it uses to implement the popup menus. The distributed version of SerialPrint II uses ID -16000 for this resource, which means it is owned by SerialPrint II and will be moved by Font/DA Mover when other DA resources are moved. Unfortunately, a CDEF with this ID can't function as a CDEF!
In order to make the real CDEF accessible to the CNTL resources that need to use it, SerialPrint II contains a fake CDEF resource with ID 254. SerialPrint II loads this resource and modifies it to jump to the code in the real CDEF. The “fake” CDEF is not owned by SerialPrint II. If you use Font/DA Mover to move SerialPrint II to another suitcase, the fake CDEF resource won't be copied. If you use Font/DA Mover to delete SerialPrint II from a suitcase, the fake CDEF won't be deleted. Since the fake CDEF is only six bytes long, leaving it in the suitcase does no harm; you can use ResEdit to remove it.
If SerialPrint II can't find the fake CDEF resource, it creates a new instance of the fake resource in the suitcase that contains the other SerialPrint II resources. Some virus detection programs such as SAM 3.0 may regard creation of a CDEF resource as a suspicious operation and display an alert; click the “allow” button to allow the operation to proceed.
Version History
1.0 - 9 June 1991 - First Release
1.0.1 - 4 July 1991 - Fixed Printers & Setups hierarchical menus to save settings; added Print… button to startup dialog box
1.1 - 10 August 1991 - Fixed CDEF resource numbering problem
Future Versions
In future versions I plan to add support for the Communications Toolbox and the ability to define new printers and setups from within SerialPrint II. Please contact me if there are other features you'd like to see provided.
Acknowledgements
SerialPrint II is based on the SerialPrint DA written by Earle R. Horton in 1987. I kept most of Earle’s low level code for driving the serial ports, changed the user interface, and added printing options.
Chris Johnson provided the popup control used to implement popup menus in dialog boxes.
James W. Walker provided the code used to implement the scrolling window you’re using to read this help text. I liked his Distribution Policy, so I decided to adopt it for SerialPrint II.
Thanks to Earle for providing the foundation for this DA. Thanks to Chris and James for their patience in dealing with my frequent questions. Pete Gontier and Lloyd Lim provided helpful advice on how to use a CDEF from a DA.
Distribution Policy
SerialPrint II is provided free of charge to all Macintosh users. It can be distributed freely, provided that both the software and this documentation are always distributed together, in whole and unchanged. SerialPrint II may not be sold or offered for sale, or included with another software product offered for sale, except with the express written permission of the author. Companies that distribute public domain/freeware/shareware software for profit are expressly prohibited from distributing SerialPrint II. This restriction does not apply to bulletin boards, commercial on-line services such as America Online, CompuServe and GEnie, and non-profit Macintosh user groups that hold regularly scheduled public meetings.
I've tested SerialPrint II extensively and have attempted to find and correct all defects. SerialPrint II comes with no warranty. I cannot be responsible for any damages, either direct or indirect, incurred as a result of using SerialPrint II.
System Requirements
SerialPrint II requires a Macintosh with a printer connected to one of the serial ports. Some features are not available on older Macs (pre-Plus). I developed SerialPrint II on a 4MB SE running 6.0.5. SerialPrint II has not been tested (yet) with System 7. I was unable to test with pre-6.0 versions of the MacOS.
Please Write
Let me know what you think of SerialPrint II; if you find SerialPrint II useful, please send a postcard or an email message. In particular, let me know about any problems or ways in which I can improve SerialPrint II. If you send me the definition strings for a widely used printer, I’ll try to provide a definition for it in a future release.